package lms.dwr.demo.service;

import java.util.List;

import lms.dwr.demo.common.ServiceException;
import lms.dwr.demo.model.ModelDistrict;

public interface ServiceDistrict 
extends ServiceBase
{
	/**
	 * Obtains the district entity with
	 * the specified id.
	 * 
	 * @param id
	 *               the district entity id
	 * @return district entity
	 * @throws ServiceException
	 */
	ModelDistrict getDistrictById (String id) throws ServiceException;
	
	/**
	 * Obtains sublist of district entities with
	 * the parent district entity id.
	 * 
	 * @param parentId
	 *               the parent district id
	 * @return sublist of district entities
	 * @throws ServiceException
	 */
	List<ModelDistrict> getSubDistrictsByParent (String parentId) throws ServiceException;
	
	/**
	 * Obtains list of district entities with 
	 * the specified entity.
	 * 
	 * @param entity
	 *                the district entity
	 * @return list of district entities
	 * @throws ServiceException
	 */
	List<ModelDistrict> getDistrictByEntity (ModelDistrict entity) throws ServiceException;
	
	/**
	 * Saves or update the specified entity
	 * 
	 * @param entity
	 *               the district entity
	 * @throws ServiceException
	 */
	void saveOrUpdate (ModelDistrict entity) throws ServiceException;
	
}
